package dmxGroupControl.solvers;

import dmxGroupControl.Channel;
import dmxGroupControl.Fixture;

import java.util.Arrays;
import java.util.List;

public class MasterAtFullSolver extends Solver
{
    private static List<String> solvableChannels = Arrays.asList("Master");
    private static List<String> solvableAttributes = Arrays.asList("");
    
    Fixture fixture;
    
    public MasterAtFullSolver(Fixture fixture)
    {
        this.fixture = fixture;
    }
    
    @Override
    public void SolveInternal()
    {
        
        Channel master = fixture.GetChannels().GetChannel("Master");
        master.SetValue(1.0f);
    }

    @Override
    public void Set(String attributeName, float value)
    {
    }

    @Override
    public String GetType()
    {
        return "masterAtFull";
    }
    
    @Override
    public boolean SolvesAttribute(String attribute)
    {
        return SolvesAttribute(attribute, solvableAttributes);
    }
    
    public static boolean GetIsApplicableToFixture(Fixture fixture)
    {
        return Solver.GetIsApplicableToFixture(fixture, solvableChannels);
    }

    @Override
    public float GetAttribute(String name)
    {
        return 1.0f;
    }
}
